home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MISC.SWG / 0105_Re Anti-debugging...??.pas < prev    next >
Pascal/Delphi Source File  |  1994-08-24  |  1KB  |  59 lines

  1. {
  2. │ Now, just to bring this home, I want to make it take over the
  3. │ debugging interrupts.  (INT 3, is it?)  I am just wondering if this
  4. │ has been done and if anyone has some TP/TASM code already created for
  5. │ this purpose.
  6.  
  7. in case the debugger executes an int1 or int 3, all you will get is the
  8. message "OOPS". not really secure, but for most cases QUITE good enough.
  9.  
  10. }
  11.  
  12. Unit Nodebug;
  13.  
  14. Interface
  15.  
  16. {*************************************************}
  17. {*                                               *}
  18. {*  All actions will be handled by the           *}
  19. {*  initialisation and the Exitprozedure         *}
  20. {*  thus no exported declarations needed         *}
  21. {*                                               *}
  22. {*************************************************}
  23.  
  24. Implementation
  25.  
  26. Uses Dos,Crt;
  27.  
  28. Var
  29.    Oldint1,
  30.    Oldint3,
  31.    Exitsave   : Pointer;
  32.  
  33.     Procedure Donotdebug; Interrupt;
  34.     Begin
  35.        Writeln ('OOPS??  pleeze no debuggung !!!!' );
  36.        Writeln;
  37.        Halt (255);
  38.     End;
  39.  
  40. {$F+}
  41.     Procedure Resetnodebug;
  42. {$F-}
  43.     Begin
  44.        Setintvec ( 1, Oldint1 );
  45.        Setintvec ( 3, Oldint3 );
  46.        Exitproc  := Exitsave;
  47.     End;
  48.  
  49. Begin
  50.    Exitsave := Exitproc;
  51.    Exitproc := @Resetnodebug;
  52.    Getintvec ( 1, Oldint1 );
  53.    Getintvec ( 3, Oldint3 );
  54.    Setintvec ( 3, @Donotdebug );
  55.    Setintvec ( 1, @Donotdebug );
  56. End.
  57.  
  58.  
  59.